<!DOCTYPE html>
<html lang="en">
<head>
    <title>微信公众号-已添加模板消息列表</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=86e2297f">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=222aea35">

</head>
<body>
<section class="content" id="list">
    <div class="box-header" style="text-align:right;padding-bottom: 10px;">
        <!--<input v-if="PerES" type="button" value="展会安排汇总" class="btn oaBtn btn-sm" @click="exhibitionSummary()" style="margin-right: 10px;">-->
        <!--<input v-if="salerManager" type="button" value="新增展会" id="addExhibition" class="btn oaBtn btn-sm" style="margin-right: 10px;" @click="add(0,'add')">-->
        <input type="button" value="修改行业" id="exhibitioneReport" class="btn oaBtn btn-sm " @click="report()">
    </div>
    <div class="box-body no-padding" style="overflow: auto;background: #fff;">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th style="width:10%;text-align: center">标题</th>
                <!--<th style="width:20%;text-align: center">模板id</th>-->
                <th style="width:30%;text-align: center">模板内容</th>
                <th style="width:15%;text-align: center">所属主营行业</th>
                <th style="width:15%;text-align: center">所属副营行业</th>
                <th style="width:10%;text-align: center">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr v-for="(item,i) in list">
                <td>{{item.title}}</td>
                <!--<td>{{item.template_id}}</td>-->
                <td>{{item.content}}</td>
                <td>{{item.primary_industry}}</td>
                <td>{{item.deputy_industry}}</td>
                <td style="text-align: center">
                    <!--<a href="javascript:void(0);" @click="del(item.template_id)">删除</a>-->
                    <a href="javascript:void(0);" @click="edit(item.template_id, item.content)">使用</a>
                </td>
            </tr>
            </thead>
        </table>
    </div>
    <!-- /.box-body -->
</section>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=8e743a31"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=54c6b89c"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script type="text/javascript">

    var app = new Vue({
        el: '#list',
        data: {
            list:"",
            code:"",
            state:""
        },
        methods: {
            refresh: function () {
                var that = this;
                $.wyui.postMethod("/template/getPrivateTemplate.json", null, function (r) {
                    console.log(r);
                    that.list = r["template_list"];
                });
            },
            edit: function (templateid, content) {
                $.dialog({
                    content: 'url:detail.html?templateid=' + templateid + '&content=' + content,
                    title: '编辑并使用模板',
                    width: 500,
                    height: 420,
                    max: false,
                    min: false,
                    lock: true
                });
            }
        },

        mounted: function () {
            var that = this;

            $.wyui.postMethod("/template/getPrivateTemplate.json", null, function (r) {
                console.log(r);
                that.list = r["template_list"];
            });

            this.code = $.wyui.page.urlParams.code;
            this.state = $.wyui.page.urlParams.state;
            if (this.code != null && this.code.length > 0){
                $.wyui.postMethod("/weChatOAuth/getUserInfo.json", {"code":this.code,"state":this.state}, function (r) {
                    console.log(r);
                });
            }
        }
    });
</script>

</body>
</html>